import 'package:flutter/material.dart';

import '../constants.dart';
import '../size_config.dart';

class DefaultButton extends StatelessWidget {
  const DefaultButton({
    Key key,
    this.text,
    this.press,
  }) : super(key: key);
  final String text;
  final Function press;

  @override
  Widget build(BuildContext context) {
    return SizedBox(
      width: double.infinity,
      height: getProportionateScreenHeight(56),
      child: Container(
        height: getProportionateScreenHeight(56),
        width: double.infinity,
        decoration: BoxDecoration(
            color: kPrimaryColor, borderRadius: BorderRadius.circular(20)),
        child: ClipRRect(
          borderRadius: BorderRadius.circular(20),
          child: TextButton(
            onPressed: press,
            child: Text(
              text,
              textAlign: TextAlign.center,
              style: TextStyle(
                fontSize: getProportionateScreenWidth(18),
                color: Colors.white,
              ),
            ),
          ),
        ),
      ),

      //     FlatButton(
      //   shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(20)),
      //   color: kPrimaryColor,
      //   onPressed: press,
      //   child: Text(
      //     text,
      //     style: TextStyle(
      //       fontSize: getProportionateScreenWidth(18),
      //       color: Colors.white,
      //     ),
      //   ),
      // ),
    );
  }
}
